package com.leadingsoft.pwxk.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.leadingsoft.pwxk.dto.PagingTableDto;
import com.leadingsoft.pwxk.dto.PwBaseInfoDto;
import com.leadingsoft.pwxk.dto.SearchDto;
import com.leadingsoft.pwxk.service.PwBaseInfoService;

import io.swagger.annotations.Api;

/**
 * @author: lipan 2018年5月17日
 * @description: ( 排污单位基本信息 )
 * 
 */
@Api(description = "排污单位信息相关")
@RestController
@RequestMapping("api/pwbinfo")
public class PwBaseInfoController {

	@Autowired
	private PwBaseInfoService pwBaseInfoService;

	@GetMapping(params = { "draw" })
	PagingTableDto<PwBaseInfoDto> list(SearchDto searchDto,
			@RequestParam(value = "draw", required = false) Long draw) {
		PagingTableDto<PwBaseInfoDto> list = pwBaseInfoService.list(searchDto);
		list.setDraw(draw);
		return list;
	}

	@GetMapping("/{dataid}")
	PwBaseInfoDto get(@PathVariable(value = "dataid") String dataid) {
		return pwBaseInfoService.get(dataid);
	}

}
